home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dme / rexxbind.a < prev    next >
Text File  |  1997-09-09  |  2KB  |  119 lines

  1. ; === rexxbind.asm =====================================================
  2. ;
  3. ; Copyright (c) 1986, 1987 by William S. Hawes (All Rights Reserved)
  4. ;
  5. ; ======================================================================
  6. ; "Glue" routines for calling functions in the ARexx Systems Library.
  7. ; All calls assume that the external _RexxSysBase has been set to the
  8. ; ARexx SYstems library base by a call to OpenLibrary.
  9.  
  10.     section text,CODE
  11.  
  12.         XREF     _RexxSysBase
  13.  
  14. _LVOCreateRexxMsg    equ    -$90
  15. _LVODeleteArgstring    equ    -$84
  16. _LVODeleteRexxMsg    equ    -$96
  17. _LVOFreePort        equ    -$EA
  18. _LVOInitPort        equ    -$E4
  19. _LVOIsRexxMsg        equ    -$A8
  20. _LVOCreateArgstring    equ    -$7E
  21. _LVOClearMem        equ    -$D8
  22.  
  23. ; First calling convention:
  24. ; 1, 2, or 3 parameters in (A0,A1,D0), return value in D0.
  25.  
  26.      ; msgptr = CreateRexxMsg(&replyport,&fileext,&hostname)
  27.  
  28.      XDEF      _CreateRexxMsg
  29. _CreateRexxMsg:
  30.      move.w   #_LVOCreateRexxMsg,d1
  31.      bra      CallSeq1
  32.  
  33.  
  34.      ; DeleteArgstring(argptr)
  35.  
  36.      XDEF      _DeleteArgstring
  37. _DeleteArgstring:
  38.      move.w   #_LVODeleteArgstring,d1
  39.      bra      CallSeq1
  40.  
  41.  
  42.      ; DeleteRexxMsg(msgptr)
  43.  
  44.      XDEF      _DeleteRexxMsg
  45. _DeleteRexxMsg:
  46.      move.w   #_LVODeleteRexxMsg,d1
  47.      bra      CallSeq1
  48.  
  49.  
  50.      ; FreePort(&msgport)
  51.  
  52.      XDEF      _FreePort
  53. _FreePort:
  54.      move.w   #_LVOFreePort,d1
  55.      bra      CallSeq1
  56.  
  57.  
  58.      ; signal = InitPort(&replyport)
  59.  
  60.      XDEF      _InitPort
  61. _InitPort:
  62.      move.w   #_LVOInitPort,d1
  63.      bra      CallSeq1
  64.  
  65.  
  66.      ; boolean = IsRexxMsg(msgptr)
  67.  
  68.      XDEF      _IsRexxMsg
  69. _IsRexxMsg:
  70.      move.w   #_LVOIsRexxMsg,d1
  71.      bra      CallSeq1
  72.  
  73.      ; Load three arguments into (A0,A1,D0)
  74.  
  75.      nop        ;fix lattice assembler bug
  76.  
  77. CallSeq1 movea.l  4(sp),a0
  78.      movea.l  8(sp),a1
  79.      move.l   12(sp),d0
  80.  
  81.  
  82.      ; Call the library function
  83.  
  84. CallFunc move.l   a6,-(sp)
  85.      movea.l  _RexxSysBase(A4),a6
  86.      jsr      0(a6,d1.w)
  87.      movea.l  (sp)+,a6
  88.      rts
  89.  
  90.  
  91. ; Second calling convention:  2 parameters in (A0,D0), return value in D0.
  92.  
  93.      ; argptr = CreateArgstring(&string,length)
  94.  
  95.      XDEF      _CreateArgstring
  96. _CreateArgstring:
  97.      moveq      #_LVOCreateArgstring,d1
  98.      bra      CallSeq2
  99.  
  100.  
  101.      ; ClearMem(address,length)
  102.  
  103.      XDEF      _ClearMem
  104. _ClearMem:
  105.      move.w   #_LVOClearMem,d1
  106.      bra      CallSeq2
  107.  
  108.  
  109.      ; Load two arguments (A0,D0)
  110.  
  111.      nop    ;fix lattice assembler bug
  112.  
  113. CallSeq2 movea.l  4(sp),a0
  114.      move.l   8(sp),d0
  115.      bra      CallFunc
  116.  
  117.      END
  118.  
  119.